/*
 * @Author: zhangzhen
 * @Date: 2023-01-03 09:01:36
 * @LastEditors: zhangzhen
 * @LastEditTime: 2023-01-09 13:25:35
 *
 */

import {Radio, Form} from 'antd';
import React from 'react';
import {FormConTextValueType} from '../context';

const FormItem = Form.Item;

const RadioComponent: React.FC<FormConTextValueType> = (props) => {
    const {
        label,
        name,
        rules,
        required,
        infoCome,
        isSearch,
        isShowInTable,
        defaultValue,
        labelSpan,
        ...radioProps
    } = props;
    return (
        <FormItem
            label={label}
            labelCol={{flex: `${labelSpan}px`}}
            name={name}
            rules={rules}
            required={required}
            initialValue={defaultValue}>
            <Radio.Group {...radioProps} />
        </FormItem>
    );
};

export default RadioComponent;
